package org.example.controller;

import org.example.domain.TodyFruit;
import org.example.response.ApiResponse;
import org.example.service.TodyFruitService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/api/todyFruit")
public class TodyFruitController {
    @Autowired
    private TodyFruitService todyFruitService;

    /**
     * 获取所有货架水果
     * @return 水果列表
     */
    @GetMapping("/getAllFruit")
    public ApiResponse<List<TodyFruit>> getAllFruits() {
        List<TodyFruit> fruits = todyFruitService.getAllFruits();
        return ApiResponse.success(fruits);
    }


}
